package cn.devzyh.oms.coms.api.shipment.converter;

import cn.devzyh.oms.coms.api.order.entity.OrderDetail;
import cn.devzyh.oms.coms.api.order.entity.OrderHeader;
import cn.devzyh.oms.coms.api.shipment.entity.ShipmentDetail;
import cn.devzyh.oms.coms.api.shipment.entity.ShipmentHeader;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface ShipmentConverter {

	ShipmentConverter INSTANCE = Mappers.getMapper(ShipmentConverter.class);

	@Mapping(target = "createBy", ignore = true)
	@Mapping(target = "createTime", ignore = true)
	@Mapping(target = "updateBy", ignore = true)
	@Mapping(target = "updateTime", ignore = true)
	@Mapping(target = "delFlag", ignore = true)
	ShipmentHeader toShipmentHeader(OrderHeader orderHeader);

	@Mapping(target = "createBy", ignore = true)
	@Mapping(target = "createTime", ignore = true)
	@Mapping(target = "updateBy", ignore = true)
	@Mapping(target = "updateTime", ignore = true)
	@Mapping(target = "delFlag", ignore = true)
	ShipmentDetail toShipmentDetail(OrderDetail orderDetail);

}
